From 3ef1b387bcee52a2d85be1a9ef2cbc6a3a813293 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 12 Jun 2014 14:15:26 +0200 Subject: [PATCH] window: Only claim a button=1 press sequence when dragging is about to happen This way plain clicks can be handled in gtkmain through the usual delivery mechanism, and get possibly handled too by widgets holding a GTK+ grab. If window dragging is to be started, the sequence will be claimed (and a grab will happen afterwards), notifying properly the grabbing widget that event delivery was interrupted. This makes it possible to dismiss popovers by clicking on window headerbars, while still making it possible to drag the window with the popover opened. --- gtk/gtkwindow.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 39d3a68cd9..f8e71fcc46 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1454,9 +1454,6 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, break; } - - gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), - sequence, GTK_EVENT_SEQUENCE_CLAIMED); } static void @@ -1483,6 +1480,8 @@ multipress_gesture_stopped_cb (GtkGestureMultiPress *gesture, { gdouble x_root, y_root; + gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), + sequence, GTK_EVENT_SEQUENCE_CLAIMED); gdk_event_get_root_coords (event, &x_root, &y_root); gdk_window_begin_move_drag_for_device (gtk_widget_get_window (GTK_WIDGET (window)), gdk_event_get_device ((GdkEvent*) event), -- 2.30.2